Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown to formatted text #1604

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Conversation

joouha
Copy link
Contributor

@joouha joouha commented Mar 25, 2022

I've written a new markdown formatter for euporie, and feel it makes more sense for it to be a part of prompt_toolkit

Screenshot:

image

Markdown in image above
# Heading

## Sub-heading

## Long heading with lots of words which will wrap the words onto multiple lines on a narrow screen

*Italic*, **bold**, `code`, ~~strikethrough~~.

Inline [hyperlinks](https://python-prompt-toolkit.readthedocs.io/) and images ![](https://python-prompt-toolkit.readthedocs.io/en/master/_static/logo_400px.png) inline too.

> Quote blocks

- Lists
  - Sublists

1. Numbered
2. lists
   1. with
3. sublists

---

| **Table**    | Header | Row      |
|:-------------|:------:|---------:|
| Left         | Centre | Right    |
| *Formatting* | **in** | `tables` |


```python
def code_blocks():
    print("Hello world!")
```

Fin.

To do:

  • tests
  • examples
  • documentation

@joouha joouha marked this pull request as ready for review March 25, 2022 21:21
@joouha joouha marked this pull request as draft March 25, 2022 22:53
@jonathanslenders
Copy link
Member

This looks very very cool @joouha,
when I have a bit more bandwidth, I'll give you some feedback.

My main worry right now, when merging big stuff like this, is that the maintenance burden will also become part of prompt_toolkit and somewhat my responsibility. (I wouldn't mind if this becomes a separate project under the prompt-toolkit organization on Github, exactly like ptterm.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants